package xyz.jangle.design.mediator;

import java.util.ArrayList;
import java.util.List;
/**
 * 具体中介者
 * @author Administrator
 *
 */
public class ConcreteMediator implements Mediator{
	List<Colleague> list = new ArrayList<Colleague>();
	
	@Override
	public void registerColleague(Colleague colleague) {
		list.add(colleague);
	}

	@Override
	public void deliverMess(Colleague colleague, String mess) {
		for(Colleague coll:list) {
			if(coll != colleague) {	//排除自己
				coll.receiverMess(mess);
			}
		}
	}
	
	

}
